package collection;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

// HashMap 查询速度很快   key-value
public class Test2 {

	public static void main(String[] args) {
		
		Map map=new HashMap();
		map.put("js","剑圣");
		map.put("temo","提莫");
		map.put("ez","伊泽");
		map.put("jm","剑魔");
		
	    //如何循环  遍历
		Set set=map.keySet();
		Iterator it= set.iterator();
		while (it.hasNext()) {
			String key = (String) it.next();
			String value=(String)map.get(key);
			System.out.println(key+"----"+value);
		}
		
		/*
		System.out.println();
		 map.size()
		 * map.clear();
		 map.remove("jm");
		String v=(String)map.get("temo");
		System.out.println(v);
		*/
		

	}

}
